package com.aaa.reflect;

import com.aaa.ann.MyAnn;
import lombok.extern.java.Log;

import java.io.Serializable;
import java.util.Objects;

//@Log
//@MyAnn
@MyAnn()
public class Person implements Serializable {
    @MyAnn
    private int id;
    private String name;
//    public String name;
    public Person() {
        System.out.println("哥哥被调用了");
    }

    public Person(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {return true;}
        if (o == null || getClass() != o.getClass()) {return false;}
        Person person = (Person) o;
        return id == person.id;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
    public void introduce(){
        System.out.println("我的名字是："+name);
    }
}
